<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<title>二货GO—商品列表</title>

<!-- 导入控制显示的css -->
<link rel="stylesheet" href="member/css/commodityList.css">
<!-- 导入控制行为的js -->
<script type="text/javascript" src="component/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="member/js/commodityList.js"></script>
</head>
<body style="background-color: #F2F1ED">
	
	<jsp:include page="frame.jsp"></jsp:include>
	<div class="goodsListContainer">
		<div class="goodsCategory" id="goodsCategory">
			<ul>
				<li><a href="">手机</a></li>
				<li><a href="">相机/摄像机</a></li>
				<li><a href="">电脑/电脑周边</a></li>
				<li><a href="">电玩/随身听</a></li>
				<li><a href="">图书/CD</a></li>
				<li><a href="">运动器具/装备</a></li>
				<li><a href="">户外装备/出行</a></li>
				<li><a href="">野餐炊具/宿营装备</a></li>
				<li><a href="">女装</a></li>
				<li><a href="">男装</a></li>
				<li><a href="">旅行箱包</a></li>
				<li><a href="">鞋靴/配件配饰</a></li>
				<li><a href="">宿舍神器</a></li>
				<li><a href="">生活/日用</a></li>
				<li><a href="">家纺家饰/床上用品</a></li>
				<li><a href="">医药/急救</a></li>
				<li><a href="">美肤/化妆</a></li>
				<li><a href="">个人洗护</a></li>
				<li><a href="">卫生清洁</a></li>
				<li><a href="">营养保健</a></li>
				<li><a href="">考试/复习资料</a></li>
				<li><a href="">文具/学习用品</a></li>
				<li><a href="">学习教程</a></li>
				<li><a href="">乐器</a></li>
			</ul>
			<a id="more" class="moreCategory" href="javascript:void(0);">更多<img
				alt="" width="14px" height="14px"
				style="position: relative; top: 2px;" src="img/toTop-icon.png"></a>
		</div>
		
		<div class="goodsSearch">
				<a href="">默认</a>
				<a href="">最新</a>
				<a href="">价格</a>
				<form class="priceScope" action="" method="post">
					<input type="number" min="0" />-<input type="number" min="0" />
					<input type="submit" value="确认" />
				</form>
				<form class="area" action="" method="post">
					<select>
						<option>---省份---</option>
					</select>
					<select>
						<option>---城市---</option>
					</select>
					<select>
						<option>---高校---</option>
					</select>
					<input type="submit" value="确定" />
				</form>
			</div>
		
			<div class="goodsList">
				<c:if test="${empty pageBean.records }">
					<div style="width:100%; margin:20px auto; text-align: center;">
						<span style="line-height: 50px; color: #333;">抱歉，没有找到相关商品。</span>
					</div>
				</c:if>
				<c:if test="${not empty pageBean.records }">
					<c:forEach var="commodity" items="${pageBean.records }">
						<div class="commodityMain">
							<div class="commodityInfo">
								<div class="commodityImg">
									<a href="commodityInfo_viewDetails?commId=${commodity.id }&commMemberId=${commodity.memberId}">
										<img alt="" src="${commodity.headimgUrl }">
									</a>
								</div>
								<div class="commodityName">
									<span>${commodity.name }</span>
								</div>
								<div class="commodityTitle">
									${commodity.detail }
								</div>
								<div class="commodityPrice">
									<b>￥</b>
									<span>${commodity.transferPrice }</span>
								</div>
							</div>
						</div>
					</c:forEach>
				</c:if>
				<!-- <div class="commodityMain">
					<div class="commodityInfo">
						<div class="commodityAuthor">
							<div class="authorPic">
								<a href="javascript:void(0);">
									<img src="img/goods/goods101.jpg" alt="" />
								</a>
							</div>
							<div class="authorName">
								<a href="javascript:void(0);">猜猜我是谁</a>
							</div>
						</div>
						<div class="commodityImg">
							<a href="javascript:void(0);">
								<img alt="" src="img/goods/goods101.jpg">
							</a>
						</div>
						<div class="commodityTitle">
							哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈啊哈哈哈！
						</div>
						<div class="commodityPrice">
							<b>￥</b>
							<span>3000</span>
						</div>
					</div>
				</div> -->
			</div>

		<div class="page">
			第${pageBean.pageNum}/${pageBean.totalPage }页&nbsp;&nbsp; 
			<a href="commodityInfo_search?pageNum=1&commodityInfo.name=${commodityInfo.name }">首页</a>&nbsp;&nbsp; 
			<a href="commodityInfo_search?pageNum=${pageBean.pageNum-1<1?1:pageBean.pageNum-1}&commodityInfo.name=${commodityInfo.name }">上一页</a>&nbsp;&nbsp;
			<a href="commodityInfo_search?pageNum=${pageBean.pageNum+1>pageBean.totalPage?pageBean.totalPage:pageBean.pageNum+1}&commodityInfo.name=${commodityInfo.name }">下一页</a>&nbsp;&nbsp; 
			<a href="commodityInfo_search?pageNum=${pageBean.totalPage}&commodityInfo.name=${commodityInfo.name }">尾页</a>&nbsp;&nbsp; 
			第<input type="text" size="3" name="num" id="num" value="" />页 <a href="javascript:void(0)" onclick="jump('commodityInfo_search?pageNum=')">跳转</a>
			<script type="text/javascript">
				function jump(path){
					var str="${commodityInfo.name }";
				    var num = document.getElementById("num").value;
				    //保证是自然整数
				    var regObj = /^[1-9][0-9]*$/;
				    if(!regObj.test(num)){
					    alert("请输入自然整数");
					    return;
				    }
				    //还要小于总页数
				    if(num > "${page.totalPage}"){
					    alert("页码超出范围");
					    return;
				    }
				    //都满足才跳转
				    window.location.href="<%=basePath%>" + path + num+'&commodityInfo.name='+str;
					}
			</script>
		</div>
	</div>
	<jsp:include page="foot.jsp"></jsp:include>
</body>
</html>